home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9258 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: thorn.cc.usm.edu!news
  2. From: rmfulce@ocean.st.usm.edu (Mike Fulce)
  3. Newsgroups: comp.lang.c
  4. Subject: Limiting stdin input to "n" chars
  5. Date: 8 Mar 1996 23:26:04 GMT
  6. Organization: University of Southern Mississippi
  7. Message-ID: <4hqfmc$un7@thorn.cc.usm.edu>
  8. NNTP-Posting-Host: spruce.cc.usm.edu
  9. Mime-Version: 1.0
  10. Content-Type: Text/Plain; charset=US-ASCII
  11. X-Newsreader: WinVN 0.99.6
  12.  
  13. How do you limit the number of characters read from stdin?  What I want to do 
  14. is to automatically do a carriage return after a user enters say.. 2 digits.  
  15. I've written a few programs using scanf to get input, but it won't work for 
  16. what I need now. (I think it's because scanf is buffered I/O?).  
  17.  
  18. Please e-mail all responses to me and I will post a summary.
  19.  
  20. TIA
  21. ______________________________________________________________________________
  22. Mike Fulce                      Programmer Analyst
  23. Computing Center                University of Southern Mississippi
  24. m.fulce@usm.edu                 http://ocean.st.usm.edu/~rmfulce
  25. 207C Forrest County Hall        (601) 266-4103
  26.  
  27.